<%--
   help
   Copyright (c) 2013 ISPERP
   Version : 1.0.0
 --%>
<%@tag import="itsm.isperp.module.service.app.AppUserService"%>
<%@tag import="itsm.isperp.module.entity.app.AppUser"%>
<%@tag import="java.util.Map"%>
<%@tag import="itsm.isperp.framework.service.BaseService"%>
<%@tag import="itsm.isperp.framework.core.context.ContextHolder"%>
<%@ tag language="java" pageEncoding="UTF-8"
	deferredSyntaxAllowedAsLiteral="false" trimDirectiveWhitespaces="true"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<%@ attribute name="username" required="true" type="java.lang.String"
	description="username"%>

<%@ attribute name="viewDetail" rtexprvalue="true"
	type="java.lang.Boolean" description="是否展示用户详细信息"%>

<%
	AppUserService appUserService = ContextHolder
			.getSpringBean("appUserService");
	String path = request.getContextPath();
	AppUser us = appUserService.findByUsername(username);
%>


<c:choose>
	<c:when test="${viewDetail eq true }">
		<a href="javascript:openView()" ><%=appUserService.findByUsername(username).getFullname()%></a>
	</c:when>
	<c:otherwise>
		<%=us.getFullname()%>
	</c:otherwise>
</c:choose>
<script type="text/javascript">
    function openView()
    {
         var url="<%=path%>/app/user/view?id=<%=us.getId()%>";
		isperp.openDialog({
			title : '人员信息',
			windowSize : 'big',
			contentUrl : url
		});
	}
</script>




